home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / SymantecEventHook.java < prev    next >
Text File  |  1998-09-25  |  972b  |  32 lines

  1. package java.awt; 
  2.  
  3. public interface SymantecEventHook {
  4.     final static class Manager {
  5.         /**
  6.          * currently only one Hook is supported
  7.          */
  8.         static SymantecEventHook theHook=null;
  9.         static public void registerHook(SymantecEventHook h) {
  10.             theHook = h;
  11.         }
  12.         static public void unregisterHook(SymantecEventHook h) {
  13.             if (theHook == h)
  14.                 theHook = null;
  15.         }
  16.         static public void beforeEvent(AWTEvent ev) {
  17.            if (theHook!=null)
  18.                try {
  19.                    theHook.beforeEvent(ev);     
  20.                } catch(Exception e) {}
  21.         }
  22.         static public void afterEvent(AWTEvent ev)  { 
  23.            if (theHook!=null)
  24.                try {
  25.                    theHook.afterEvent(ev);     
  26.                } catch(Exception e) {}
  27.         }
  28.     };
  29.     public void beforeEvent(AWTEvent e);
  30.     public void afterEvent(AWTEvent e);
  31. };
  32.